package com.ydw;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import java.util.function.Consumer;

/**
 * @author Yangdw
 * @date 2025-08-30
 * @description:
 */
@SpringBootApplication
public class RocketMQConsumerApplication {
    public static void main(String[] args) {
        SpringApplication.run(RocketMQConsumerApplication.class, args);
    }

    /**
     * 消费者绑定俩个队列时候是先消费完一个队列消息在消费下一个队列消息
     * 生产者发送消息是轮询队列发送
     */

    @Value("${server.port}")
    private int port;

    @Bean
    public Consumer<String> input() {
        return message -> System.out.println("port:"+port+"Received: " + message);
    }
}
